package com.cheems.dao;

import com.cheems.entity.DTO.userDTO;
import com.cheems.entity.Pojo.user;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

@Mapper
public interface UserMapper {
    /**
     * 根据用户名查询用户
     * @param username
     * @return
     */
    @Select("select * from user where user_name=#{username}")
    user getByUsername(String username);

    /**
     * 用户注册
     * @param userDTO
     */
    @Insert("insert into user (user_name , password) values (#{username},#{password})")
    void enroll(userDTO userDTO);
}
